1. /* slosland.cpp by K.Tsuru */
  2. // function ID = 231 DRADIX
  3. /*****************************************************
  4. SLong class
  5. bit and oparator m & n
  6. It does not consider the sign and return a positive value.
  7. [Argorithm]
  8. 1.radix converion to SInteger with radix BRADIX
  9. 2.take bit and for each figure
  10. 3.reverse conversion
  11. ******************************************************/
  12. #ifndef SN_H
  13. #include "sn.h"
  14. #endif
  15. SLong operator&(const SLong& m, const SLong& n){
  16. if( m.Sign(231) == 0) return m; // return 0.0;
  17. if( n.Sign(231) == 0) return n;
  18. SInteger M, N;
  19. //convert to binary
  20. // M = m.ConvToBin(); N = n.ConvToBin(); // version 2.20
  21. M = M.ConvToBin(m); N = N.ConvToBin(n); // version 2.20
  22. M = M & N;
  23. return M.ConvToDec(); //convert to decimal
  24. }

slosland.cpp : last modifiled at 2014/05/21 22:00:08(781 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).